<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%file_list_info}}".
 *
 * @property string $id
 * @property string $notice_id
 * @property string $custom_id
 * @property int $type
 * @property string $area_no 地区号
 * @property string $plat_no 平台号
 * @property string $guaranty_unit_no 担保单位编号
 * @property string $card_no 卡号
 * @property string $name 姓名
 * @property string $cert_type 证件类型
 * @property string $cert_no 证件编号
 * @property int $card_issue_mark 发卡标识
 * @property int $reconciliation_at 对账单日
 * @property int $repayment_at 还款日
 * @property string $data_date 数据日期
 * @property string $card_balance 卡余额
 * @property string $optimal_repayment_amout 最优还款额
 * @property int $cumulative_break_contract_times 累计违约次数
 * @property int $continuity_break_contract_times 连续违约次数
 * @property string $run_branch 经办支行
 * @property string $instalment_type 分期业务种类
 * @property string $instalment_amount 分期金额
 * @property int $gather_times 汇总笔数
 * @property int $gather_amount 汇总金额
 * @property string $ugry_pay_situation 催缴情况
 * @property string $other_data 其他数据
 *
 * @property FileListDownloadLog[] $fileListDownloadLogs
 */
class FileListInfo extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%file_list_info}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['notice_id'], 'required'],
            [['notice_id', 'custom_id', 'type', 'card_issue_mark', 'reconciliation_at', 'repayment_at', 'cumulative_break_contract_times', 'continuity_break_contract_times', 'gather_times', 'gather_amount'], 'integer'],
            [['card_balance', 'optimal_repayment_amout'], 'number'],
            [['other_data'], 'string'],
            [['area_no', 'plat_no', 'guaranty_unit_no', 'card_no', 'name', 'cert_type', 'cert_no'], 'string', 'max' => 20],
            [['data_date'], 'string', 'max' => 8],
            [['run_branch', 'instalment_type', 'instalment_amount'], 'string', 'max' => 50],
            [['ugry_pay_situation'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'notice_id' => Yii::t('app', 'Notice ID'),
            'custom_id' => Yii::t('app', 'Custom ID'),
            'type' => Yii::t('app', 'Type'),
            'area_no' => Yii::t('app', '地区号'),
            'plat_no' => Yii::t('app', '平台号'),
            'guaranty_unit_no' => Yii::t('app', '担保单位编号'),
            'card_no' => Yii::t('app', '卡号'),
            'name' => Yii::t('app', '姓名'),
            'cert_type' => Yii::t('app', '证件类型'),
            'cert_no' => Yii::t('app', '证件编号'),
            'card_issue_mark' => Yii::t('app', '发卡标识'),
            'reconciliation_at' => Yii::t('app', '对账单日'),
            'repayment_at' => Yii::t('app', '还款日'),
            'data_date' => Yii::t('app', '数据日期'),
            'card_balance' => Yii::t('app', '卡余额'),
            'optimal_repayment_amout' => Yii::t('app', '最优还款额'),
            'cumulative_break_contract_times' => Yii::t('app', '累计违约次数'),
            'continuity_break_contract_times' => Yii::t('app', '连续违约次数'),
            'run_branch' => Yii::t('app', '经办支行'),
            'instalment_type' => Yii::t('app', '分期业务种类'),
            'instalment_amount' => Yii::t('app', '分期金额'),
            'gather_times' => Yii::t('app', '汇总笔数'),
            'gather_amount' => Yii::t('app', '汇总金额'),
            'ugry_pay_situation' => Yii::t('app', '催缴情况'),
            'other_data' => Yii::t('app', '其他数据'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getFileListDownloadLogs()
    {
        return $this->hasMany(FileListDownloadLog::className(), ['file_list_info_id' => 'id']);
    }
}
